package com.campus.config;

import org.springframework.context.annotation.*;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;

/**
 * @desc:
 * @author: Ping
 * @date: 2024/9/23 16:12
 */
@Configuration
@Import(ResourceConfig.class)
@EnableAspectJAutoProxy
@EnableTransactionManagement
@ComponentScan(basePackages = {"com.campus.dao","com.campus.aop","com.campus.service"})
public class SpringConfig {

    @Bean
    public PlatformTransactionManager transactionManager(DataSource dataSource) {
        return new DataSourceTransactionManager(dataSource) ;
    }



}
